package com.dongxing.concyrrency.chapter10;

import java.util.Collection;

/**
 * @author XavierDong
 **/
public interface Lock {

    class TimeOutException extends Exception {

        public TimeOutException(String message) {
            super(message);
        }
    }

    // 锁
    void lock() throws InterruptedException;

    void lock(long mills) throws InterruptedException, TimeOutException;

    void unLock();

    Collection<Thread> getBlockedThread();

    int getBlockedSize();
}
